package com.financing.wap.dao.impl;


import java.sql.SQLException;
import java.util.List;
import java.util.Map;
import org.springframework.stereotype.Repository;
import com.financing.wap.dto.FpShopSigninDTO;
import com.financing.wap.dao.IFpShopSigninDao;
import com.financing.wap.common.SqlName;
/**
 * fp_shop_signin  
 *  数据访问层实现类
 * @author huqiyun
 *
 */
 
@Repository("fpShopSigninDao")
public class FpShopSigninDaoImpl extends BaseDaoImpl<FpShopSigninDTO, java.lang.Integer> implements IFpShopSigninDao {


	@Override
	public void insert(FpShopSigninDTO fpShopSignin) throws SQLException {
		this.sqlMapClientTemplate.insert(SqlName.FpShopSigninSql.insert, fpShopSignin);
	}

	@Override
	public void update(FpShopSigninDTO fpShopSignin) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.FpShopSigninSql.update, fpShopSignin);
	}

	@Override
	public void updateForce(FpShopSigninDTO fpShopSignin) throws SQLException {
		this.sqlMapClientTemplate.update(SqlName.FpShopSigninSql.updateForce, fpShopSignin);
	}

	@Override
	public void delete(String id) throws SQLException {
		this.sqlMapClientTemplate.delete(SqlName.FpShopSigninSql.delete,id);
	}
	
	@SuppressWarnings("unchecked")	
	@Override
	public List<FpShopSigninDTO> queryList(FpShopSigninDTO fpShopSignin) throws SQLException {
		return this.sqlMapClientTemplate.queryForList(SqlName.FpShopSigninSql.queryList, fpShopSignin);
	}

	@Override
	public int queryListCount(FpShopSigninDTO fpShopSignin) throws SQLException {
		return (Integer) this.sqlMapClientTemplate.queryForObject(SqlName.FpShopSigninSql.queryListCount, fpShopSignin);
	}

	@Override
	public FpShopSigninDTO loadById(String id) throws SQLException {
		return  (FpShopSigninDTO)this.getSqlMapClientTemplate().queryForObject(SqlName.FpShopSigninSql.loadById,id);
	}

	@Override
	public Class<FpShopSigninDTO> getEntityClass() {
		return FpShopSigninDTO.class;
	}

	@Override
	public int querySortByTotal(String id) throws SQLException {
		return (Integer)this.getSqlMapClientTemplate().queryForObject(SqlName.FpShopSigninSql.querySortByTotal, id);
	}

	@Override
	public int querySortByTime(String id) throws SQLException {
		// TODO Auto-generated method stub
		return (Integer)this.getSqlMapClientTemplate().queryForObject(SqlName.FpShopSigninSql.querySortByTime, id);
	}

	@Override
	public List<FpShopSigninDTO> queryTopTen() throws SQLException {
		return this.getSqlMapClientTemplate().queryForList(SqlName.FpShopSigninSql.queryTopTen);
	}
 	
}